# autoPages

import { Badge } from '@theme';

<Badge text="add in v3.0.0-rc.10" type="warning" />

:::tip
After startup, automatically find the entry files in the `pages` directory
:::

+ Type: `boolean` | `{path:'pages'}`
+ Default: `false`

```ts title="emp-config.js"
import {defineConfig} from '@empjs/cli'
export default defineConfig(store => {
  return {
    autoPages:true
  }
})
```

## Function
+ Automatically discovers all files under `src/pages` directory and configures `html-template` based on `html` and `entries` settings, for example: 
```ts title="emp-config.js"
import {defineConfig} from '@empjs/cli'
import pluginReact from '@empjs/plugin-react'

export default defineConfig(store => {
  return {
    //开启 autoPages
    autoPages: true,
    plugins: [pluginReact()],
    // 全局设置 html 配置
    html: {
      title: 'EMP v3 Auto Pages',
    },
    // 局部设置存在页面的配置
    entries: {
      'work/index.ts': {
        title: 'auto page work',
      },
    },
  }
})


```